import cn.hutool.core.io.FileUtil;
import cn.hutool.json.JSONObject;
import com.alibaba.fastjson.JSON;

import java.io.File;
import java.util.List;


public class ReadJsonFile {

    public static List<Json> readJson(File file) {
//        File file = new File(pathname);
        // 读取JSON文件
        String jsonStr = FileUtil.readUtf8String(file);

        // 将JSON字符串转换为JSONObject对象
        return JSON.parseArray(jsonStr, Json.class);
    }


    static class Json {
        private String e_mail;
        private String File;
        private String IP;
        private String username;
        private String password;

        @Override
        public String toString() {
            return "Json{" +
                    "e_mail='" + e_mail + '\'' +
                    ", File='" + File + '\'' +
                    ", IP='" + IP + '\'' +
                    ", username='" + username + '\'' +
                    ", passworld='" + password + '\'' +
                    '}';
        }

        public String getE_mail() {
            return e_mail;
        }

        public void setE_mail(String e_mail) {
            this.e_mail = e_mail;
        }

        public String getFile() {
            return File;
        }

        public void setFile(String file) {
            File = file;
        }

        public String getIP() {
            return IP;
        }

        public void setIP(String IP) {
            this.IP = IP;
        }

        public String getUsername() {
            return username;
        }

        public void setUsername(String username) {
            this.username = username;
        }

        public String getPassword() {
            return password;
        }

        public void setPassword(String password) {
            this.password = password;
        }
    }
}
